import type { IColumnsOption } from 'vc';
import { INDEX, INFO_SOURCE } from '@/utils';

export function useTable() {
  const tableData = ref<any[]>([]);

  const columns = ref<IColumnsOption[]>([
    { ...INDEX },
    {
      title: '披露日期',
      field: 'noticeDate',
      width: 100,
      align: 'center',
      sortable: true,
      sortBy: 'noticeDate'
    },
    { ...INFO_SOURCE('') },
    {
      title: '补贴年度',
      field: 'statisticalYear',
      width: 100
    },
    {
      title: '保险金额',
      field: 'liabilityLimit',
      width: 100
    },
    {
      title: '保费金额',
      field: 'premium',
      width: 100
    },
    {
      title: '拟补贴金额',
      field: 'subsidyPlan',
      width: 100
    },
    {
      title: '考核扣除',
      field: 'subsidyDeduct',
      width: 100
    },
    {
      title: '实补贴金额',
      field: 'subsidyActual',
      width: 100
    },
    {
      title: '起保日期',
      field: 'startDate',
      width: 100
    },
    {
      title: '终保日期',
      field: 'endDate',
      width: 100
    },
    {
      title: '突发环境预案风险等级',
      field: 'riskLevel',
      width: 200
    }
  ]);

  return {
    tableData,
    columns
  };
}
